using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace WindowsPhoneGame1.GamePlayStates
{
    public class FinishState : GamePlayState
    {
        public FinishState(Game1 game, Level level)
            : base(game, level)
        {
            NUMBER_OF_BUTTONS = 1;
        }

        public override void Initialize()
        {
            base.Initialize();

            button_functions[0] = ReturnToLevelSelect;
        }

        public override void LoadContent()
        {
            base.LoadContent();
            button_texture[0] = game.Content.Load<Texture2D>("images/BoringButton");
        }

        public override void UnloadContent()
        {
            base.UnloadContent();
        }

        public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
        {
            base.Update(gameTime);
            level.GetCar().Break();
        }

        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime)
        {
            if (level.GetCar().GetSpeed() < 0.01f)
            {
                base.Draw(gameTime);
                return;
            }

            // draw stuff here.

            base.Draw(gameTime);
        }

        public bool ReturnToLevelSelect(int i, int j)
        {
            level.ReturnToLevelSelect();
            return true;
        }
    }
}
